﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if DOT_NET
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
#endif
using StyleMVVM.Data.Activation;
using StyleMVVM.DependencyInjection;
using StyleMVVM.UnitTests.TestClasses.MultipleImport;

namespace StyleMVVM.UnitTests.DependencyInjection
{
	[TestClass]
	public class MultipleImportTests : BaseTestClass
	{
		[TestMethod]
		public void ImportIListTest()
		{
			ImportIListObject newObject = Container.Locate<IActivationService>().Create<ImportIListObject>();

			Assert.IsNotNull(newObject);
			Assert.IsNotNull(newObject.ListImports);
			Assert.AreEqual(3, newObject.ListImports.Count);
		}

		[TestMethod]
		public void ImportListTest()
		{
			ImportListObject newObject = Container.Locate<IActivationService>().Create<ImportListObject>();

			Assert.IsNotNull(newObject);
			Assert.IsNotNull(newObject.ListImports);
			Assert.AreEqual(3, newObject.ListImports.Count);
		}

		[TestMethod]
		public void ImportArrayTest()
		{
			ImportArrayObject newObject = Container.Locate<IActivationService>().Create<ImportArrayObject>();

			Assert.IsNotNull(newObject);
			Assert.IsNotNull(newObject.ListImports);
			Assert.AreEqual(3, newObject.ListImports.Count());
		}

		[TestMethod]
		public void ImportIEnumerableTest()
		{
			ImportIEnumerableObject newObject = Container.Locate<IActivationService>().Create<ImportIEnumerableObject>();

			Assert.IsNotNull(newObject);
			Assert.IsNotNull(newObject.ListImports);
			Assert.AreEqual(3, newObject.ListImports.Count());
		}

		[TestMethod]
		public void ImportReadOnlyCollectionTest()
		{
			ImportReadOnlyCollectionObject newObject = Container.Locate<IActivationService>().Create<ImportReadOnlyCollectionObject>();

			Assert.IsNotNull(newObject);
			Assert.IsNotNull(newObject.ListImports);
			Assert.AreEqual(3, newObject.ListImports.Count());
		}

		[TestMethod]
		public void ImportIReadOnlyListTest()
		{
			ImportIReadOnlyListObject newObject = Container.Locate<IActivationService>().Create<ImportIReadOnlyListObject>();

			Assert.IsNotNull(newObject);
			Assert.IsNotNull(newObject.ListImports);
			Assert.AreEqual(3, newObject.ListImports.Count());
		}
	}
}